import request from "@/utils/request.js";

/**
 * 查询租户套餐列表
 * @param params
 */
export const listTenantPackage = params => {
  return request({
    url: "/dbo/system/tenant/package/list",
    method: "get",
    params
  });
};

/**
 * 查询租户套餐下拉选列表
 */
export const selectTenantPackage = () => {
  return request({
    url: "/dbo/system/tenant/package/selectList",
    method: "get"
  });
};

/**
 * 查询租户套餐详细
 * @param packageId
 */
export const getTenantPackage = packageId => {
  return request({
    url: `/dbo/system/tenant/package/${packageId}`,
    method: "get"
  });
};

/**
 * 新增租户套餐
 * @param data
 * @returns {*}
 */
export const addTenantPackage = data => {
  return request({
    url: "/dbo/system/tenant/package",
    method: "post",
    data
  });
};

/**
 * 修改租户套餐
 * @param data
 * @returns {*}
 */
export const updateTenantPackage = data => {
  return request({
    url: "/dbo/system/tenant/package",
    method: "put",
    data
  });
};

/**
 * 租户套餐状态修改
 * @param packageId
 * @param status
 * @returns {*}
 */
export const changePackageStatus = (packageId, status) => {
  const data = {
    packageId,
    status
  };
  return request({
    url: "/dbo/system/tenant/package/changeStatus",
    method: "put",
    data
  });
};

/**
 * 删除租户套餐
 * @param packageId
 * @returns {*}
 */
export const delTenantPackage = packageId => {
  return request({
    url: `/dbo/system/tenant/package/${packageId}`,
    method: "delete"
  });
};
